package tw.com.softleader.spring.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import tw.com.softleader.spring.dao.BookDao;
import tw.com.softleader.spring.entity.Book;
import tw.com.softleader.spring.service.BookService;

@Service
public class BookServiceImpl implements BookService{
	
	@Autowired
	private BookDao dao;
	
	public List<Book> getAll(){
		return dao.findAll();
	}

	@Override
	public Book getOne(Long id) {
		return dao.findOne(id);
	}

	@Override
	public void insert(Book book) {
		dao.insert(book);
	}

	@Override
	public void update(Book book) {
		dao.update(book);		
	}

	@Override
	public void delete(Long id) {
		dao.delete(id);		
	}




}
